package com.gxuwz.check.model.entity;

import javax.persistence.*;

@Entity
@Table(name = "sys_student", schema = "check_db", catalog = "")
public class SysStudentEntity {
    private int studentId;
    private String studentName;
    private String studentTel;
    private Integer studentSex;
    private Integer userId;
    private Integer classId;

    @Id
    @Column(name = "student_id", nullable = false)
    public int getStudentId() {
        return studentId;
    }

    public void setStudentId(int studentId) {
        this.studentId = studentId;
    }

    @Basic
    @Column(name = "student_name", nullable = true, length = 30)
    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    @Basic
    @Column(name = "student_tel", nullable = true, length = 11)
    public String getStudentTel() {
        return studentTel;
    }

    public void setStudentTel(String studentTel) {
        this.studentTel = studentTel;
    }

    @Basic
    @Column(name = "student_sex", nullable = true)
    public Integer getStudentSex() {
        return studentSex;
    }

    public void setStudentSex(Integer studentSex) {
        this.studentSex = studentSex;
    }

    @Basic
    @Column(name = "user_id", nullable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "class_id", nullable = true)
    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysStudentEntity that = (SysStudentEntity) o;

        if (studentId != that.studentId) return false;
        if (studentName != null ? !studentName.equals(that.studentName) : that.studentName != null) return false;
        if (studentTel != null ? !studentTel.equals(that.studentTel) : that.studentTel != null) return false;
        if (studentSex != null ? !studentSex.equals(that.studentSex) : that.studentSex != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (classId != null ? !classId.equals(that.classId) : that.classId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = studentId;
        result = 31 * result + (studentName != null ? studentName.hashCode() : 0);
        result = 31 * result + (studentTel != null ? studentTel.hashCode() : 0);
        result = 31 * result + (studentSex != null ? studentSex.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (classId != null ? classId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SysStudentEntity{" +
                "studentId=" + studentId +
                ", studentName='" + studentName + '\'' +
                ", studentTel='" + studentTel + '\'' +
                ", studentSex=" + studentSex +
                ", userId=" + userId +
                ", classId=" + classId +
                '}';
    }
}
